/*
 * GPSWidget.h
 *
 *  Created on: Jan 21, 2011
 *      Author: kmueller
 */

#ifndef GPSWIDGET_H_
#define GPSWIDGET_H_

#include <QDialog>

class QLabel;
class QWidget;
class ExtendedGeoPositionInfo;
class PLLayout;
class QBoxLayout;

class GPSWidget: public QDialog {
Q_OBJECT

public:
	GPSWidget(QWidget *parent = 0);

protected:
	void resizeEvent(QResizeEvent* event);

private slots:
	void updateAll(const ExtendedGeoPositionInfo* info);
	void setVelocity(const ExtendedGeoPositionInfo* info);
	void setHeading(const ExtendedGeoPositionInfo* info);
	void setCoordinates(const ExtendedGeoPositionInfo* info);
	void setTime(const ExtendedGeoPositionInfo* info);
	void setAccuracy(const ExtendedGeoPositionInfo* info);
	void setFixType(const ExtendedGeoPositionInfo* info);
private:
	void init();
	void createLandscape();
	void createPortrait();
	void createAutoLayout();

	QLabel* altitude;
	QLabel* longitude;
	QLabel* latitude;
	QLabel* heading;
	QLabel* velocity;
	QLabel* time;
	QLabel* fix;
	QLabel* hAccuracy;
	QLabel* vAccuracy;

	QBoxLayout *landscapeLayout;
	QBoxLayout *portraitLayout;
	PLLayout* autoLayout;
};

#endif /* GPSWIDGET_H_ */
